<?php

namespace common\models\base;

use Yii;

/**
 * This is the model class for table "{{%loan_apply}}".
 *
 * @property int $id
 * @property string $order_id 订单编号，如浙B04-160111-004
 * @property string $request_id 请求编号
 * @property string $debt_name 借款人姓名
 * @property string $id_card_no 借款人身份证号码
 * @property string $mobile_no 借款人手机号码
 * @property int $created_at 请求时间
 * @property string $other_data
 * @property string $apply_company
 * @property string $contract 借款合同号
 */
class LoanApply extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%loan_apply}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['order_id', 'request_id', 'debt_name', 'id_card_no', 'mobile_no', 'created_at', 'apply_company', 'contract'], 'required'],
            [['created_at'], 'integer'],
            [['other_data'], 'string'],
            [['order_id', 'request_id', 'contract'], 'string', 'max' => 50],
            [['debt_name'], 'string', 'max' => 255],
            [['id_card_no', 'apply_company'], 'string', 'max' => 20],
            [['mobile_no'], 'string', 'max' => 13],
            [['request_id'], 'unique'],
            [['order_id'], 'unique'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => Yii::t('app', 'ID'),
            'order_id' => Yii::t('app', '订单编号，如浙B04-160111-004'),
            'request_id' => Yii::t('app', '请求编号'),
            'debt_name' => Yii::t('app', '借款人姓名'),
            'id_card_no' => Yii::t('app', '借款人身份证号码'),
            'mobile_no' => Yii::t('app', '借款人手机号码'),
            'created_at' => Yii::t('app', '请求时间'),
            'other_data' => Yii::t('app', 'Other Data'),
            'apply_company' => Yii::t('app', 'Apply Company'),
            'contract' => Yii::t('app', '借款合同号'),
        ];
    }
}
